<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>贷后数据详情</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div id="ligergrid1" class="sq-grid"></div>
</div>

<!-- 客户类型 -->
<div id="div_customer_type" style="display:none">

</div>

<script type="text/javascript">
    var grid = null;

    $(function () {
        initGrid();//注意初始化要在initForm之后,因为在初始化grid的时候需要form参数
    });

    //初始化列表
    function initGrid() {
        $("#ligergrid1").ligerGrid({
            url: '<%=path%>/capital/insFileSync/initInsFileDList.do',
            method: 'get',
            parms: {'id' : ${id}},
            columns: [
                {
                    display: '我司合同号', name: 'cntNo', width: 150, align: 'center', enabledSort: true
                },
                {display: '期次', name: 'payPd', width: 60, enabledSort: true},
                {display: '资方合同号', name: 'insCntNo', width: 150, align: 'left', enabledSort: true},
                {display: '应收日期', name: 'payDt', width: 80, enabledSort: true,
                    render:function (rowdata) {
                        return renderDate(rowdata.payDt);
                    }
                },
                {display: '当期应收本金', name: 'capAmt', width: 80, enabledSort: true,
                    render:function(rowdata,index,value){
                        if(rowdata.capAmt){
                            return '&yen;'+FormatMoney(rowdata.capAmt/100);
                        }
                    }},
                {display: '当期实收本金', name: 'paidCapAmt', width: 80, enabledSort: true,
                    render:function(rowdata,index,value){
                        if(rowdata.paidCapAmt){
                            return '&yen;'+FormatMoney(rowdata.paidCapAmt/100);
                        }
                    }},
                {display: '当期应收利息', name: 'intrAmt', width: 80, enabledSort: true,
                    render:function(rowdata,index,value){
                        if(rowdata.intrAmt){
                            return '&yen;'+FormatMoney(rowdata.intrAmt/100);
                        }
                    }},
                {display: '当期实收利息', name: 'paidIntrAmt', width: 80, enabledSort: true,
                    render:function(rowdata,index,value){
                        if(rowdata.paidIntrAmt){
                            return '&yen;'+FormatMoney(rowdata.paidIntrAmt/100);
                        }
                    }},
                {display: '当期应收罚息', name: 'penaltyAmt', width: 80, enabledSort: true,
                    render:function(rowdata,index,value){
                        if(rowdata.penaltyAmt){
                            return '&yen;'+FormatMoney(rowdata.penaltyAmt/100);
                        }
                    }},
                {display: '当期实收罚息', name: 'paidPenaltyAmt', width: 80, enabledSort: true,
                    render:function(rowdata,index,value){
                        if(rowdata.paidPenaltyAmt){
                            return '&yen;'+FormatMoney(rowdata.paidPenaltyAmt/100);
                        }
                    }},
                {display: '逾期状态', name: 'ovdSts', width: 80, enabledSort: true,
                    render:function(rowdata,index,value){
                        if(1 == rowdata.ovdSts){
                            return '是';
                        } else if (0 == rowdata.ovdSts) {
                            return '否';
                        }
                    }},
                {display: '更新状态', name: 'dataStatus', width: 80, enabledSort: true,
                    render:function(rowdata,index,value){
                        if(1 == rowdata.dataStatus){
                            return '成功';
                        } else if (0 == rowdata.dataStatus) {
                            return '失败';
                        }
                    }}
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: true,
            rownumbers: true
        });
        grid = liger.get("ligergrid1");
        grid.setHeight(100);
        grid.options.isSingleCheck = true;
    }

    //格式化时间
    function renderDate(value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }

</script>

</body>
</html>